Port to C11 aligned_alloc, and fix some integer overflows.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Nov 2013 05:31:04 +0000 (21:31 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Nov 2013 05:31:04 +0000 (21:31 -0800)
commit89a5fb98faf6184842aeded7e30c88415072ddea
tree19c11d9d0adaa5806f3790fcc317b42945e994a0
parent35d9b9823f8ab9137b551d43c4f762c92c43ab06
Port to C11 aligned_alloc, and fix some integer overflows.

* configure.ac (GMALLOC_OBJ): Initialize to empty if !system_malloc
and doug_lea_malloc.
(aligned_alloc): Test for existence if !GMALLOC_OBJ and not darwin.
(posix_memalign): Test for existence only if !GMALLOC_OBJ and
not darwin and !aligned_alloc.
* src/alloc.c (USE_ALIGNED_ALLOC): New symbol.
(USE_POSIX_MEMALIGN): Remove.  All uses replaced with USE_ALIGNED_ALLOC,
and use of posix_memalign replaced with aligned_alloc.
(aligned_alloc): New function, defined or declared as needed.
* src/conf_post.h (HAVE_POSIX_MEMALIGN) [DARWIN_OS]:
Don't undef; configure.ac now does this.
* src/gmalloc.c (aligned_alloc) [MSDOS]: New decl.
(calloc, aligned_alloc): Check for integer overflow.
(aligned_alloc): Rename from memalign.  All uses changed.
(memalign): New function, an alias for aligned_alloc.
ChangeLog
configure.ac
src/ChangeLog
src/alloc.c
src/conf_post.h
src/gmalloc.c